# Maintainer: Ivan Semkin (ivan at semkin dot ru)

pkgname=indicator-network-git
_pkgname=indicator-network
pkgver=r1949.27fabbd2
pkgrel=3
pkgdesc='Network indicator'
url='https://github.com/ubports/indicator-network'
arch=(x86_64 i686 armv7h aarch64)
license=(LGPL3 GPL3)
conflicts=(indicator-network)
provides=(indicator-network)
depends=(lcov gcovr gsettings-qt ofono url-dispatcher-git libqofono libqtdbustest-git libqtdbusmock-git gmenuharness-bzr)
makedepends=(git cmake cmake-extras-git doxygen)
checkdepends=()
source=('git+https://github.com/ubports/indicator-network.git')
sha256sums=('SKIP')

BUILDENV+=('!check') # Hangs

pkgver() {
  cd ${_pkgname}
  echo "r$(git rev-list --count HEAD).$(git describe --always)"
}

prepare() {
  cd ${_pkgname}
  git checkout bionic
}

build() {
  cd ${_pkgname}
  mkdir -p build
  cd build
  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR="lib/" -DCMAKE_INSTALL_LIBEXECDIR="lib/" ..
  make
}

check() {
  cd ${_pkgname}/build
  export PYTHONIOENCODING=UTF-8
  make ARGS+="--output-on-failure" test
}

package() {
  cd ${_pkgname}/build
  make DESTDIR="${pkgdir}/" install
  mv ${pkgdir}/usr/lib/qt5/ ${pkgdir}/usr/lib/qt/
}
# vim:set ts=2 sw=2 et:
